package com.cug.zfanspring.controller;


import com.cug.zfanspring.bean.*;
import com.cug.zfanspring.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class ShowController {
//    @Autowired
//    DeviceAlarmService deviceAlarmService;
//    @Autowired
//    IndexAlarmService indexAlarmService;
//    @Autowired
//    DialService dialService;
    @Autowired
    ProportionalDataService proportionalDataService;
//    @Autowired
//    SynthesisDataService synthesisDataService;
    @Autowired
    FactorDataService factorDataService;
    @Autowired
    DeviceDataService deviceDataService;
//    @RequestMapping(value = "/alarm/deviceAlarm", method = RequestMethod.GET, produces ="application/json" )
//    public List<DeviceAlarm> getAllEquipmentFailure() { return deviceAlarmService.getAllEquipmentFailure(); }
//
//    @RequestMapping(value = "/alarm/indexAlarm", method = RequestMethod.GET, produces ="application/json" )
//    public List<IndexAlarm> getAllExceedingAlert() {
//        return indexAlarmService.getAllExceedingAlert();
//    }
//
//    @RequestMapping(value = "/sewage/properties", method = RequestMethod.GET, produces ="application/json" )
//    public Dial getInformationOnDial() {
//        return dialService.getDial();
//    }
//
//    @RequestMapping(value = "/DeviceStatistic", method = RequestMethod.GET, produces ="application/json" )
//    public List<Map<String,Long>> getDeviceProportionalData() {
//        return proportionalDataService.getDeviceProportionalData();
//    }
//
//    @RequestMapping(value = "/IndexStatistic", method = RequestMethod.GET, produces ="application/json" )
//    public List<Map<String,Long>> getIndexProportionalData() {
//        return proportionalDataService.getIndexProportionalData();
//    }
//
//    @RequestMapping(value = "/synthesis", method = RequestMethod.GET, produces ="application/json" )
//    public SynthesisData getSynthesisData() {
//        return synthesisDataService.getSynthesisData();
//    }
//


    @RequestMapping(value = "/alarm/factor", method = RequestMethod.GET, produces ="application/json" )
    @ResponseBody
    public List<Factor> GetFactorData(){ return factorDataService.getAlarmFactorData();}


    @RequestMapping(value = "/alarm/device", method = RequestMethod.GET, produces ="application/json" )
    @ResponseBody
    public List<Device> GetDeviceData(){ return deviceDataService.getAlarmDeviceData();}

    @RequestMapping(value = "/statistic/factor", method = RequestMethod.GET, produces ="application/json" )
    @ResponseBody
    public List<TransportFormat01>  GetFactorStatistic(String area){ return proportionalDataService.getFactorStatisticData(area);}

    @RequestMapping(value = "/statistic/device", method = RequestMethod.GET, produces ="application/json" )
    @ResponseBody
    public List<TransportFormat01> GetDeviceStatistic(String area){ return proportionalDataService.getDeviceStatisticData(area);}

    @RequestMapping(value = "/properites/factor", method = RequestMethod.GET, produces ="application/json" )
    @ResponseBody
    public  Map<String,TransportFormat02> GetFactorProperites(String area){ return proportionalDataService.getFactorproperitesData(area);}


    @RequestMapping(value="/area/name",method = RequestMethod.GET,produces = "application/json")
    @ResponseBody
    public   List<String> GetAreaName(){return deviceDataService.getAreaName();}




}
